<template>
  <div id="app">
    <keep-alive exclude="Detail">
      <router-view />
    </keep-alive>
    <main-tab-bar></main-tab-bar>
  </div>
</template>

<script>
import MainTabBar from "components/content/mainTabbar/MainTabBar";
export default {
  name: "app",
  data() {
    return {
      name: "" //防止抖屏
    };
  },
  components: {
    MainTabBar
  },
  watch: {
    //监视路由的变化
    $route(to, from) {
      if (from.path === "/") return;
      if (to.meta.index > from.meta.index) {
        this.name = "left";
      } else {
        this.name = "right";
      }
    }
  }
};
</script>

<style>
@import url("./assets/css/base.css");
</style>
